package com.mxdx.edu.service.impl;

import com.mxdx.edu.dao.CourseDao;
import com.mxdx.edu.service.ICourseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 专业信息service
 *
 * @author howie
 */
@Service
public class CourseServiceImpl implements ICourseService {

	@Resource
	private CourseDao courseDao;

	@Override
	public List<Map<String, Object>> findListBySemesterId(String semesterId) {
		Map<String, Object> param = new HashMap<>();
		param.put("semesterId", semesterId);
		return courseDao.findListByMap(param);
	}

	@Override
	public Map<String, Object> findCourseInfoByIdAndStudentType(String courseId, int studentType) {
		Map<String, Object> param = new HashMap<>();
		param.put("courseId", courseId);
		param.put("studentType", studentType);
		List<Map<String, Object>> list = courseDao.findListByMap(param);
		if(list != null && list.size() > 0){
			return list.get(0);
		}
		return null;
	}


}
